package org.jflame.devAide;

import java.nio.file.Path;
import java.util.Locale;

import org.jflame.devAide.util.ResourceUtils;

import javafx.application.HostServices;
import javafx.stage.Stage;

public final class AppContext {

    public static final String[] BASE_STYLE_FILES = { ResourceUtils.cssUrl("base"),ResourceUtils.cssUrl("plugin") };

    private static Setting setting;// 系统设置
    private static Stage mainStage;// 主界面场景
    private static HostServices hostServices;
    private static Locale locale = Locale.CHINA;
    /**
     * 应用根路径
     */
    public static Path BASE_DIR;

    /**
     * 数据存放路径
     */
    public static Path DATA_DIR;

    public static Path CFG_FILE;

    private AppContext() {
    }

    public static Stage mainStage() {
        return mainStage;
    }

    static void setMainStage(final Stage _mainStage) {
        if (mainStage == null) {
            mainStage = _mainStage;
        }
    }

    static void setSetting(final Setting _setting) {
        setting = _setting;
    }

    public static Setting setting() {
        return setting;
    }

    static void setHostServices(HostServices _hostServices) {
        hostServices = _hostServices;
    }

    public static String appTitle() {
        return ResourceUtils.getString("app.title");
    }

    public static HostServices hostServices() {
        return hostServices;
    }

    public static Locale getLocale() {
        return locale;
    }

    public static void setLocale(Locale locale) {
        AppContext.locale = locale;
    }

}
